Don't access label->layout directly. (#157080, Adam Hooper)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 3 Nov 2004 06:36:32 +0000 (06:36 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 3 Nov 2004 06:36:32 +0000 (06:36 +0000)
2004-11-03  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't
access label->layout directly.  (#157080, Adam Hooper)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkaccellabel.c

index 03fa58ae922ba6064f9ab5ef1f9790c4ce5d95ca..763d8421bf4ffec738f6b6e3357d60e39ffdb7ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't
+       access label->layout directly.  (#157080, Adam Hooper)
+
        * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow
        unsetting a pattern by passing NULL.  (#156720, Tristan Van Berkom)
 
index 03fa58ae922ba6064f9ab5ef1f9790c4ce5d95ca..763d8421bf4ffec738f6b6e3357d60e39ffdb7ee 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't
+       access label->layout directly.  (#157080, Adam Hooper)
+
        * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow
        unsetting a pattern by passing NULL.  (#156720, Tristan Van Berkom)
 
index 03fa58ae922ba6064f9ab5ef1f9790c4ce5d95ca..763d8421bf4ffec738f6b6e3357d60e39ffdb7ee 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't
+       access label->layout directly.  (#157080, Adam Hooper)
+
        * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow
        unsetting a pattern by passing NULL.  (#156720, Tristan Van Berkom)
 
index 03fa58ae922ba6064f9ab5ef1f9790c4ce5d95ca..763d8421bf4ffec738f6b6e3357d60e39ffdb7ee 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't
+       access label->layout directly.  (#157080, Adam Hooper)
+
        * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow
        unsetting a pattern by passing NULL.  (#156720, Tristan Van Berkom)
 
index 73b27e52a5f08d605af3a5cf6ae88088d92d5014..ab0ce47dc8b484e9d8913b85d5f59855ef8aea51 100644 (file)
@@ -325,12 +325,14 @@ gtk_accel_label_expose_event (GtkWidget      *widget,
          gint x;
          gint y;
          
+         label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
+
          if (direction == GTK_TEXT_DIR_RTL)
            widget->allocation.x += ac_width;
          widget->allocation.width -= ac_width;
          if (gtk_label_get_ellipsize (label))
-           pango_layout_set_width (label->layout,
-                                   pango_layout_get_width (label->layout) 
+           pango_layout_set_width (label_layout,
+                                   pango_layout_get_width (label_layout) 
                                    - ac_width * PANGO_SCALE);
          
          if (GTK_WIDGET_CLASS (parent_class)->expose_event)
@@ -339,8 +341,8 @@ gtk_accel_label_expose_event (GtkWidget      *widget,
            widget->allocation.x -= ac_width;
          widget->allocation.width += ac_width;
          if (gtk_label_get_ellipsize (label))
-           pango_layout_set_width (label->layout,
-                                   pango_layout_get_width (label->layout) 
+           pango_layout_set_width (label_layout,
+                                   pango_layout_get_width (label_layout) 
                                    + ac_width * PANGO_SCALE);
          
          if (direction == GTK_TEXT_DIR_RTL)
@@ -348,7 +350,6 @@ gtk_accel_label_expose_event (GtkWidget      *widget,
          else
            x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width;
 
-         label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
          gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y);
 
          accel_layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));